// components/role-input/role-input.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: ''
    },
    isNecessary: {
      type: Boolean,
      value: true
    },
    placeholder: {
      type: String,
      value: ''
    },
    password: {
      type: Boolean,
      value: false
    },
    disabled: {
      type: Boolean,
      value: false
    },
    // 用于Form表达
    name: {
      type: String,
      value: ''
    },
    focus: {
      type: Boolean,
      value: false
    },
    type: {
      type: String,
      value: 'text'
    },
    value: {
      type: String,
      value: ""
    },
    isArrowShow: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindInput: function(e) {
      //1.更新界面
      this.setData({
        myDetail: e.detail.value
      })
      //2.传值
      var myEventDetail = {
        content: e.detail.value
      }
      var myEventOption = {} // 触发事件的选项
      this.triggerEvent('myinput', myEventDetail, myEventOption);
    }
  }
})